package cn.wolfcode.enums;

import lombok.Getter;

@Getter
public enum ConsumptionEnums {
    //    枚举类只能get,不能set.左边为name,右边为value
    CONSUME("待结算",0),
    AUDIT("待审核",1),
    FINISH("归档",2),
    FAILURE("坏账",3);

    private Integer value;
    private String name;


    ConsumptionEnums(String name,Integer value) {
        this.name = name;
        this.value=value;
    }




    public static String findName(Integer value){
        ConsumptionEnums[] values = ConsumptionEnums.values();
        for (ConsumptionEnums starus:values){
            if (starus.getValue().equals(value)){
                return starus.getName();
            }
        }
        return null;
    }
}
